From: Roland McGrath Date: Mon, 26 Apr 1993 21:54:00 +0000 (+0000) Subject: (Fexpand_file_name): Don't remove trailing / from NEWDIR if just "/". X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1^2~5^2~96469 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=f1cc678fdca621df8eb39f65054195388a0bca94;p=emacs.git (Fexpand_file_name): Don't remove trailing / from NEWDIR if just "/". --- diff --git a/src/fileio.c b/src/fileio.c index 05cc4677b64..6c74dccc2ee 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -1,5 +1,5 @@ /* File IO for GNU Emacs. - Copyright (C) 1985, 1986, 1987, 1988, 1992 Free Software Foundation, Inc. + Copyright (C) 1985, 1986, 1987, 1988, 1992, 1993 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -847,7 +847,7 @@ See also the function `substitute-in-file-name'.") { /* Get rid of any slash at the end of newdir. */ int length = strlen (newdir); - if (newdir[length - 1] == '/') + if (length > 1 && newdir[length - 1] == '/') { unsigned char *temp = (unsigned char *) alloca (length); bcopy (newdir, temp, length - 1);